package com.battleship;

import android.app.Activity;
import android.os.Bundle;
import android.provider.Settings;
import android.view.WindowManager;

public class BrightnessActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setTheme(R.style.Theme_Transparent);
		Bundle extras = getIntent().getExtras();
		int paramBright = extras.getInt("paramBright");
		Settings.System.putInt(this.getContentResolver(),
				Settings.System.SCREEN_BRIGHTNESS_MODE,
				Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL);
		Settings.System.putInt(this.getContentResolver(),
				Settings.System.SCREEN_BRIGHTNESS, paramBright);
		WindowManager.LayoutParams layout = getWindow().getAttributes();
		layout.screenBrightness = paramBright;
		getWindow().setAttributes(layout);
		
		finish();

	}

}
